<?php

namespace app\common\model;
use think\Model;

class Contract extends Model
{
    
  protected $autoWriteTimestamp = true;
  
  public function brand()
  {
      return $this->hasOne('Brand','id','brand_id')->field('id,name');
  }
  
  public function rent()
  {
      return $this->hasMany('Rent','contract_no','contract_no');
  }
  
  /* protected $type = [
      'dispatch_time'  =>  'timestamp:Y-m-d',
  ]; */
}
